﻿using ConfExpert.Forms.Depo;
using DevTeam;
using System.IO;

namespace ConfExpert.Utility
{
    public class CommandManager
    {
        public static void ExecuteFile(string FileName)
        {
            string[] lines = File.ReadAllLines(FileName);
            foreach (string line in lines)
            {
                if (line.ToUpper().Contains("SHOW"))
                {
                    string[] commands = line.Split(' ');
                    string form = commands[1];
                    if (form == "ConfExpert.Forms.Depo.CikisEmirleri")
                    {
                        //if (commands[2].Contains(","))
                        //{
                            foreach (string id in commands[2].Split(','))
                            {
                                int cikisEmriId = id.ToInt(-1);
                                AppSession.MainForm.ShowMdiChildForm(typeof(CikisEmirleri), cikisEmriId);
                            }
                        //}
                        //else
                        //{
                        //    int cikisEmriId = commands[2].ToInt(-1);
                        //    AppSession.MainForm.ShowMdiChildForm(typeof(CikisEmirleri), cikisEmriId);
                        //}
                        
                    }
                }
            }
        }
    }
}
